﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/DefaultNonMenu.master" AutoEventWireup="true" CodeBehind="ProductDetail.aspx.cs" Inherits="Runda.EShop.Web.Customer.ProductDetail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHeader" runat="server">
    <script type="text/javascript">
        function CheckOnAddCart() {
//            if ($('.defaultDecimalTextBox').val() == '') {
//                alert('请输入购买数量.');
//                return false;
            //            }

            var flag = false;
            $('.defaultDecimalTextBox').each(function () {
                if ($(this).val() != '') {
                    flag = true;
                }
            });

            if (!flag) {
                alert('请输入购买数量.');
                return false;
            }
        }
    </script> 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
    <div class="i_tablebt_xian" style="margin: 10px 0px 0px 0px; width: 100%;">
        <span class="l"><img src="<%=ResolveUrl("~/images/ico/down_16x16.gif")%>" align="absmiddle" />产品信息</span>
    </div>
    <div class="clear"></div>
<div style="width:200px;margin:3px 5px 3px 0;float:left;">
<asp:Image ID="imgProduct" runat="server" Width="180px" Height="240px"/>
</div>
<div style="width:518px;margin:3px 5px 3px 0;float:left;">
    <table cellspacing="3px" cellpadding="3px" width="100%" class="i_center_table11">
    <tr>
    <td colspan="4" align="center">
    <div style="font-size:18px;">
        <asp:Literal ID="ltlProductName" runat="server"></asp:Literal></div>
        </td>
    </tr>
      <tr>
    <td style="width:60px">货 号:</td><td style="width:200px">
          <asp:Literal ID="ltlProductCode" runat="server"></asp:Literal>
          </td>
          <td style="width:60px">
              大 类:</td>
          <td style="width:318px">
          <asp:Literal ID="ltlAbbrName" runat="server"></asp:Literal>
          </td>
    </tr>
      <tr>
    <td style="width:60px">别 名:</td><td style="width:200px">
          <asp:Literal ID="ltlAlias" runat="server"></asp:Literal>
          </td>
          <td style="width:60px">
              品 牌:</td>
          <td style="width:318px">
          <asp:Literal ID="ltlTrademark" runat="server"></asp:Literal>
          </td>
    </tr>
      <tr>
    <td style="width:60px">规 格:</td><td>
          <asp:Literal ID="ltlStandard" runat="server"></asp:Literal>
          </td>
          <td style="width:60px">
              单 位:</td>
          <td>
          <asp:Literal ID="ltlUnit" runat="server"></asp:Literal>
          </td>
    </tr>
      <tr>
    <td colspan="4" align="left">
          <asp:PlaceHolder ID="phOrder" runat="server"></asp:PlaceHolder>
    </td>
    </tr>
    <tr>  
    <td style="text-align:right" colspan="2">
        <asp:ImageButton  ID="btnAddCart" runat="server" ImageUrl="../Images/btn/appendToCart.gif" onclick="btnAddCart_Click" OnClientClick="return CheckOnAddCart();" ValidationGroup="group1"/>
    </td>
    <td style="text-align:center" colspan="2">
        <img src="../Images/btn/btn_return.gif" style="cursor:pointer;" onclick="window.close();" />
    </td>
    </tr>
    </table> 
</div>
<div class="clear"></div>
<div class="i_tablebt_xian" style="margin: 10px 0px 0px 0px; width: 100%;">
        <span class="l"><img src="<%=ResolveUrl("~/images/ico/down_16x16.gif")%>" align="absmiddle" />关联产品</span>
    </div>
    <div class="clear"></div>
    <asp:GridView ID="gvRelationProduct" runat="server" AutoGenerateColumns="False" OnRowCommand="gvRelationProduct_RowCommand"
        OnRowDataBound="gvRelationProduct_RowDataBound">
        <Columns>
            <asp:TemplateField HeaderText="订购" Visible="false">
                <ItemTemplate>
                    <asp:Button ID="btnOrder" runat="server" Text="订购" CommandName="order" CommandArgument='<%# Eval("ProductID") %>' />
                </ItemTemplate>
                <ItemStyle Width="60px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="产品编号">
                <ItemTemplate>
                    <asp:HyperLink ID="lnkView" runat="server" NavigateUrl='<%# "ProductDetail.aspx?ProductID="+Eval("ProductID") %>'><%# Eval("ProductCode") %></asp:HyperLink>
                </ItemTemplate>
                <ItemStyle Width="80px" />
            </asp:TemplateField>
            <asp:BoundField DataField="ProductName" HeaderText="产品名称" ItemStyle-Width="270px" />
            <asp:BoundField DataField="Standard" HeaderText="规格" ItemStyle-Width="140px" />
            <asp:BoundField DataField="BatchCode" HeaderText="批次号" />
            <asp:BoundField DataField="DueDate" HeaderText="有效期" DataFormatString="{0:yyyy-MM-dd}" />
        </Columns>
    </asp:GridView>

<div class="i_tablebt_xian" style="margin: 10px 0px 0px 0px; width: 100%;">
        <span class="l"><img src="<%=ResolveUrl("~/images/ico/down_16x16.gif")%>" align="absmiddle" />该产品购买历史</span>
    </div>
<div class="clear"></div>
    <asp:GridView ID="gvOrderDetailHistory" runat="server" AutoGenerateColumns="False">
        <Columns>
            <asp:BoundField DataField="OrderDate" HeaderText="购买日期" />
            <asp:BoundField DataField="Quantity" HeaderText="购买数量" />
        </Columns>
    </asp:GridView>
</asp:Content>
